package com.itheima.HomeWork;

import java.util.*;
import java.util.stream.Stream;

public class Demo01 {
    public static void main(String[] args) {
        List<String> one = new ArrayList<>();
        one.add("黄老邪");
        one.add("陈玄风");
        one.add("梅超风");
        one.add("陆乘风");
        one.add("曲灵风");
        one.add("武眠风");
        one.add("冯默风");
        one.add("罗玉风");
        List<String> two = new ArrayList<>();
        two.add("张三丰");
        two.add("宋远桥");
        two.add("俞莲舟");
        two.add("俞岱岩");
        two.add("张松溪");
        two.add("张翠山");
        two.add("殷梨亭");
        two.add("莫声谷");

        System.out.println("第一个队伍筛选后");
        Stream<String> oneString=one.stream()
                .filter(i->i.length()==3)
                .limit(3);

        System.out.println("整个person对象信息");
        Stream<String > newTwo=two.stream()
                .filter(i->i.charAt(0)=='张')
                .skip(2);

        Stream.concat(newTwo,oneString).map(i->new Person(i)).forEach(i-> System.out.println(i));

    }
}
 class Person {

    private String name;

    public Person() {}

    public Person(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{name='" + name + "'}";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
